package com.dl7.mvp.api;

import com.dl7.mvp.local.table.AlbumsVideoList;
import com.dl7.mvp.local.table.AlbumsListBean;
import com.dl7.mvp.local.table.RecommendAlbumsListBean;
import com.dl7.mvp.local.table.VideoList;

import java.util.List;

import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Path;
import retrofit2.http.Query;
import rx.Observable;

import static com.dl7.mvp.api.RetrofitService.CACHE_CONTROL_NETWORK;

/**
 * Created by long on 2016/8/22.
 * API 接口
 */
public interface INewsApi {
    /**
     * 获取推荐视频列表
     * @return
     */
    @Headers(CACHE_CONTROL_NETWORK)
    @GET("api/v1/home_items")
    Observable<VideoList> getRecommendedVideoList(@Query("type") int type, @Query("channel") String channel, @Query("offset") int offset, @Query("limit") int limit);

    /**
     * 获取所有专辑分类以及专辑列表
     * http://api.ergedd.com//api/v1/album_categories?channel=new&offset=0&limit=100&addition_album_count=20
     * @return
     */
    @Headers(CACHE_CONTROL_NETWORK)
    @GET("api/v1/album_categories")
    Observable<AlbumsListBean> getCategoryVideoList(@Query("channel") String channel, @Query("offset") int offset, @Query("limit") int limit, @Query("addition_album_count") int addition_album_count);


    /**
     * 获取专辑包含的视频列表
     * http://api.ergedd.com/api/v1/albums/175/videos?channel=new&offset=0&limit=20
     * @return
     */
    @Headers(CACHE_CONTROL_NETWORK)
    @GET("api/v1/albums/{id}/videos")
    Observable<AlbumsVideoList> getAlbumsList(@Path("id") int id, @Query("channel") String channel, @Query("offset") int offset, @Query("limit") int limit);

    /**
     * 获取推荐专辑列表
     * http://api.ergedd.com/api/v1/albums/home_recommended?channel=new&offset=0&limit=16
     * @return
     */
    @Headers(CACHE_CONTROL_NETWORK)
    @GET("api/v1/albums/home_recommended")
    Observable<RecommendAlbumsListBean> getRecommendAlbumsList(@Query("channel") String channel, @Query("offset") int offset, @Query("limit") int limit);
}
